a = str(input())
for i in range(len(a)):
  if "()" in a:
    a = a.replace("()", "")
  if "[]" in a:
    a = a.replace("[]", "")
  if "{}" in a:
    a = a.replace("{}", "")
if a == "":
  print("true")
else:
  print("false")
